<!DOCTYPE html>
<html lang="zh-CN">
<meta charset="utf-8" />
<head>
<title>审核媒体 <?php echo $this->config->item('title');?>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet"	href="<?php echo base_url()?>public/css/bootstrap.min.css">
<link rel="stylesheet"	href="<?php echo base_url()?>public/css/style.css">
<link rel="stylesheet" href="<?php echo base_url()?>public/css/bootstrap-select.min.css">
</head>
<body>
	<script src="<?php echo base_url()?>public/js/jquery-2.0.2.min.js"></script>
	<script src="<?php echo base_url()?>public/js/bootstrap.min.js"></script>
	<script src="<?php echo base_url()?>public/js/bootstrap-confirm.js"></script>
	<script src='<?php echo base_url()?>public/js/bootbox.min.js'></script>
	<script src='<?php echo base_url()?>public/js/jquery.form.js'></script>
	<script src='<?php echo base_url()?>public/js/ssi_common.js'></script>
	<script type="text/javascript"	src="http://api.map.baidu.com/api?v=1.5&ak=C17fc65597a3939334b09677dcba39fd"></script>
	<script type="text/javascript"	src="http://api.map.baidu.com/library/DistanceTool/1.2/src/DistanceTool_min.js"></script>
	<script src='<?php echo base_url()?>public/js/bootstrap-select.min.js'></script>
	<script type="text/javascript">
	
	function buildMarker(map, x, y) {
		var newmarker = new BMap.Marker(new BMap.Point(x, y));
		map.addOverlay(newmarker);
		newmarker.enableDragging(true);
		newmarker.enableMassClear();
		return newmarker;
	}
	function updatePoint(point) {
		$("#longitude").val(point.lng);
		$("#latitude").val(point.lat);
	}
	var map;
	$().ready(function() {
		map = new BMap.Map("map");
		map.enableScrollWheelZoom();//允许滚轮缩放
		map.addControl(new BMap.NavigationControl());//加载放大缩小插件
		var local = new BMap.LocalSearch(map, {renderOptions:{map: map}});
		$('#searchbtn').click(function() {
			var key = $('#searchtext').val();
			local.searchInBounds(key, map.getBounds());
		});
		map.addEventListener("click",function(e){
			//新增地图标注
			map.clearOverlays();
			var marker = buildMarker(map, e.point.lng, e.point.lat);
			updatePoint(e.point);
			marker.addEventListener("dragend", function(e2) {
			updatePoint(e2.point);
			});
		});
		var longitude = $("#longitude").val();
		var latitude = $("#latitude").val();
		if (longitude) {
			 map.centerAndZoom(new BMap.Point(longitude, latitude), 13);
			 marker = buildMarker(map, longitude, latitude);
		} else {
			 map.centerAndZoom("武汉"); 
		}
		$('.selectpicker1').selectpicker({});
		$('.selectpicker').selectpicker();

		$(".open_detail").click(function(){
			$(this).siblings().toggle();
			if ($(this).text()=="查看编辑详情[ + ]") {
				$(this).text("[ - ]");
			}else{
				$(this).text("查看编辑详情[ + ]");
			}
		});
		 
	});
	</script>
	<div role="navigation" class="navbar navbar-inverse navbar-fixed-top">
		<div class="container">
			<div class="navbar-header">
				<a class="navbar-brand">SSI后台管理系统</a>
			</div>
			<div class="collapse navbar-collapse navbar-right">
				<ul class="nav navbar-nav">
					<li><a href="<?php echo base_url()?>" class="navbar-link">首页</a></li>
					<li><a
						href="<?php echo base_url()."index.php/common_login_user_set"?>"
						class="navbar-link">超级管理员</a></li>
					<li><a
						href="<?php echo base_url()?>index.php/common_login_manage/logout"
						class="navbar-link">退出</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-xs-3">
				<?php echo $user_menu?>
			</div>
			<div class="col-md-9">
				<div class="panel panel-default">
					<div class="panel-heading">编辑媒体</div>
					<div class="panel-body">
						<form method="post" enctype="multipart/form-data" id="main_from1"	action="<?php echo base_url()."index.php"?>/media_media_manage/not_allow_draft" class="form-horizontal">
							<div  class="form-group">
								<label for="" class="control-label col-sm-3">媒体类型</label>
								<div class="col-sm-5">
									<p class='form-control-static'>
									<?php if ($media_draft_info['media_type']=="led") {
										echo "市区LED大牌";
									}elseif($media_draft_info['media_type']=="common"){
										echo "市区常规大牌";
									}elseif($media_draft_info['media_type']=="highway"){
										echo "高速公路大牌";
									}elseif($media_draft_info['media_type']=="airport"){
										echo "机场常规大牌";
									}elseif($media_draft_info['media_type']=="airport_led"){
										echo "机场LED大牌";
									} ?>
									</p>
								</div>
							</div>
							<div id="Parents" class="form-group">
								<label for="parent1" class="control-label col-sm-3">所属地区</label>
								<div id="parents " class="col-sm-5">
									<p class='form-control-static'>
									<?php echo $media_draft_info['province_name'];
										if ($media_draft_info['city_name']) {
											echo " - ".$media_draft_info['city_name'];
										}
										if ($media_draft_info['region_type']=="10") {
											echo " - 中心城区";
										}elseif ($media_draft_info['region_type']=="20") {
											echo " - 周边城区";
										}elseif ($media_draft_info['region_type']=="30") {
											echo " - 下属县市";
										}elseif ($media_draft_info['region_type']=="40") {
											echo " - 下属镇区";
										}
										if ($media_draft_info['region_name']) {
											echo " - ".$media_draft_info['region_name'];
											
										}
									?>
									</p>
								</div>
							</div>
							<div  class="form-group">
								<label for="location" class="control-label col-sm-3">媒体位置</label>
								<div class="col-sm-5">
								<p class='form-control-static'>
								<?php echo $media_draft_info['location']?>
								</p>
								</div>
							</div>
							<input id="latitude" name="latitude" value="<?php echo $media_draft_info['latitude']?>" type="hidden">
							<input id="longitude" name="longitude" value="<?php echo $media_draft_info['longitude']?>" type="hidden">
							<div class="form-group">
								<div id="map" style="height: 400px;"
									class="col-sm-10 col-sm-offset-1"></div>
							</div>
							<br>
							<div  class="form-group vendor">
								<label for="vendor" class="control-label col-sm-3 ">供应商</label>
								<div class="col-sm-5" >
								<p class='form-control-static'>
								<?php echo $media_draft_info['company_name']==""?"无":$media_draft_info['company_name'];?>
								</p>
								</div>
							</div>
							<?php if ($media_draft_info['media_type']=="led"||$media_draft_info['media_type']=="common") {?>
							<div  class="form-group">
								<label  class="control-label col-sm-3">媒体环境</label>
								<div class="col-sm-5">
									<p class='form-control-static'>
									商 圈 环 境 :
									<?php 	if ($circle_list!=null) {
												foreach ($circle_list as $circle){
													if($env_list!=null) {
														foreach ($env_list as $env){
															if ($env['env_type']=="circle"&&$env['env_id']==$circle['env_id']) {
															echo '<a target="_blank" href="'.base_url().'index.php/media_env_urban_manage/query_env_urban_circle?env_id='.$env['env_id'].'">'.$circle['env_name'].'</a>';
															}
														}
													}
												}
											}?>
									</p>
									<p class='form-control-static'>
									 主干道环境 :
									<?php 	if ($road_list!=null) {
												foreach ($road_list as $road){
													if($env_list!=null) {
														foreach ($env_list as $env){
															if ($env['env_type']=="road"&&$env['env_id']==$road['env_id']) {
															echo '<a target="_blank" href="'.base_url().'index.php/media_env_urban_manage/query_env_urban_road?env_id='.$env['env_id'].'">'.$road['env_name'].'</a>';
															}
														}
													}
												}
											}?>
									</p>
									<p class='form-control-static'>
									专业市场环境:
									<?php 	if ($market_list!=null) {
												foreach ($market_list as $market){
													if($env_list!=null) {
														foreach ($env_list as $env){
															if ($env['env_type']=="market"&&$env['env_id']==$market['env_id']) {
															echo '<a target="_blank" href="'.base_url().'index.php/media_env_urban_manage/query_env_urban_market?env_id='.$env['env_id'].'">'.$market['env_name'].'</a>';
															}
														}
													}
												}
											}?>
									</p>
									<p class='form-control-static'>
									火车站环境 :
									<?php 	if ($station_list!=null) {
												foreach ($station_list as $station){
													if($env_list!=null) {
														foreach ($env_list as $env){
															if ($env['env_type']=="station"&&$env['env_id']==$station['env_id']) {
															echo '<a target="_blank" href="'.base_url().'index.php/media_env_urban_manage/query_env_urban_station?env_id='.$env['env_id'].'">'.$station['env_name'].'</a>';
															}
														}
													}
												}
											}?>
									</p>
									<p class='form-control-static'>
									汽车站环境 :
									<?php 	if ($stop_list!=null) {
												foreach ($stop_list as $stop){
													if($env_list!=null) {
														foreach ($env_list as $env){
															if ($env['env_type']=="stop"&&$env['env_id']==$stop['env_id']) {
															echo '<a target="_blank" href="'.base_url().'index.php/media_env_urban_manage/query_env_urban_stop?env_id='.$env['env_id'].'">'.$stop['env_name'].'</a>';
															}
														}
													}
												}
											}?>
									</p>
									<p class='form-control-static'>
									大型场馆环境:
									<?php 	if ($venues_list!=null) {
												foreach ($venues_list as $venues){
													if($env_list!=null) {
														foreach ($env_list as $env){
															if ($env['env_type']=="venues"&&$env['env_id']==$venues['env_id']) {
															echo '<a target="_blank" href="'.base_url().'index.php/media_env_urban_manage/query_env_urban_venues?env_id='.$env['env_id'].'">'.$venues['env_name'].'</a>';
															}
														}
													}
												}
											}?>
									</p>
									<p class='form-control-static'>
									CBD环境:
									<?php 	if ($cbd_list!=null) {
												foreach ($cbd_list as $cbd){
													if($env_list!=null) {
														foreach ($env_list as $env){
															if ($env['env_type']=="cbd"&&$env['env_id']==$cbd['env_id']) {
															echo '<a target="_blank" href="'.base_url().'index.php/media_env_urban_manage/query_env_urban_cbd?env_id='.$env['env_id'].'">'.$cbd['env_name'].'</a>';
															}
														}
													}
												}
											}?>
									</p>
									<p class='form-control-static'>
									政务区环境:
									<?php 	if ($chief_district_list!=null) {
												foreach ($chief_district_list as $chief_district){
													if($env_list!=null) {
														foreach ($env_list as $env){
															if ($env['env_type']=="chief_district"&&$env['env_id']==$chief_district['env_id']) {
															echo '<a target="_blank" href="'.base_url().'index.php/media_env_urban_manage/query_env_urban_chief_district?env_id='.$env['env_id'].'">'.$chief_district['env_name'].'</a>';
															}
														}
													}
												}
											}?>
									</p>
									<p class='form-control-static'>
									工业区环境:
									<?php 	if ($industrial_list!=null) {
												foreach ($industrial_list as $industrial){
													if($env_list!=null) {
														foreach ($env_list as $env){
															if ($env['env_type']=="industrial"&&$env['env_id']==$industrial['env_id']) {
															echo '<a target="_blank" href="'.base_url().'index.php/media_env_urban_manage/query_env_urban_industrial?env_id='.$env['env_id'].'">'.$industrial['env_name'].'</a>';
															}
														}
													}
												}
											}?>
									</p>
								</div>
							</div>
							<?php }?>
							<?php if ($media_draft_info['media_type']=="highway") {?>
							<div  class="form-group">
								<label  class="control-label col-sm-3">高速公路</label>
								<div class="col-sm-5">
									<p class='form-control-static'>
									<?php if ($highway_list!=null) {
												foreach ($highway_list as $highway){ 
													if ($highway['highway_id']== $media_draft_info['highway_id']) {
													echo '<a target="_blank" href="'.base_url().'index.php/media_env_highway_manage/query_env_highway?highway_id='.$media_draft_info['highway_id'].'">'.$highway['highway_name'].'</a>';
													break;
													}
												}
											}?>
									</p>
									</select>
								</div>
							</div>
							<div  class="form-group">
								<label  class="control-label col-sm-3">高速路段</label>
								<div class="col-sm-5">
									<p class='form-control-static'>
									<?php if ($section_list!=null) {
												foreach ($section_list as $section){ 
													if ($section['section_id']== $media_draft_info['section_id']) {
														echo '<a target="_blank" href="'.base_url().'index.php/media_env_highway_manage/query_highway_section?section_id='.$media_draft_info['section_id'].'">'.$section['section_name'].'</a>';
														break;
														}
												}
											}?>
									</p>
								</div>
							</div>
							<div  class="form-group">
								<label  class="control-label col-sm-3">关卡点位</label>
								<div class="col-sm-5">
									<p class='form-control-static'>
									<?php if ($point_list!=null) {
												foreach ($point_list as $point){ 
													if ($point['point_id']== $media_draft_info['point_id']) {
														echo '<a target="_blank" href="'.base_url().'index.php/media_env_highway_manage/query_highway_point?point_id='.$media_draft_info['point_id'].'">'.$point['point_name'].'</a>';
														break;
													}
												}
											}?>
									</p>
								</div>
							</div>
							<?php }?>
							<?php if ($media_draft_info['media_type']=="airport"||$media_draft_info['media_type']=="airport_led") {?>
							<div  class="form-group">
								<label  class="control-label col-sm-3">所属机场</label>
								<div class="col-sm-5">
										<p class='form-control-static'>
										<?php if ($airport_list!=null) {
												foreach ($airport_list as $airport){ 
													if ($airport['airport_id']== $media_draft_info['airport_id']) {
														echo $airport['airport_name'];
														break;
													}
												}
											}?>
										</p>
								</div>
							</div>
							<div  class="form-group">
								<label for="media_type_id" class="control-label col-sm-3">媒体形式</label>
								<div class="col-sm-5">
								<p class='form-control-static'>
										<?php echo $media_draft_info['media_type_name']==""?"无":$media_draft_info['media_type_name']?>
									</p>
								</div>
							</div>
							<div  class="form-group">
								<label for="agreement" class="control-label col-sm-3">是否有手续</label>
								<div class="col-sm-5">
										<p class='form-control-static'>
											<?php if ($media_draft_info['agreement']==0) {
												echo "暂无信息";
											}elseif($media_draft_info['agreement']==10){
												echo "政府批文";
											}elseif($media_draft_info['agreement']==20){
												echo "场租协议";
											}elseif($media_draft_info['agreement']==30){
												echo "采购合同";
											}?>
										</p>
								</div>
							</div>
							<div  class="form-group">
								<label for="specification_width" class="control-label col-sm-3">媒体宽</label>
								<div class="col-sm-5">
									<p class='form-control-static'><?php echo $media_draft_info['specification_width']?> (米)</p>
								</div>
							</div>
							<div  class="form-group">
								<label for="specification_height" class="control-label col-sm-3">媒体高</label>
								<div class="col-sm-5">
									<p class='form-control-static'><?php echo $media_draft_info['specification_height']?> (米)</p>
								</div>
							</div>
							<div  class="form-group">
								<label for="specification" class="control-label col-sm-3">详细规格</label>
								<div class="col-sm-5">
								<p class='form-control-static'><?php echo $media_draft_info['specification']==""?"无":$media_draft_info['specification']?> 平米</p>
								</div>
							</div>
							<div  class="form-group">
								<label for="media_area" class="control-label col-sm-3">媒体面积</label>
								<div class="col-sm-5">
									<p class='form-control-static'>
									<?php echo $media_draft_info['media_area_name']==""?"无":$media_draft_info['media_area_name']?>
									</p>
								</div>
							</div>
							<div  class="form-group">
								<label for="reference_price" class="control-label col-sm-3">交易参考价</label>
								<div class="col-sm-5">
								<p class='form-control-static'><?php echo $media_draft_info['reference_price']==""?"无":$media_draft_info['reference_price']?></p>
								</div>
							</div>
							<div  class="form-group">
								<label for="reference_price" class="control-label col-sm-3">价格备注</label>
								<div class="col-sm-5">
								<p class='form-control-static'><?php echo $media_draft_info['price_remark']==""?"无":$media_draft_info['price_remark']?></p>
								</div>
							</div>
							<?php }?>
							<?php if ($media_draft_info['media_type']=="airport"
										||$media_draft_info['media_type']=="common"
										||$media_draft_info['media_type']=="highway") {?>
							
							
							<div  class="form-group">
								<label for="crafts" class="control-label col-sm-3">制作工艺</label>
								<div class="col-sm-5">
									<p class='form-control-static'>
									<?php echo $media_draft_info['crafts_name']==""?"无":$media_draft_info['crafts_name'] ?>
									</p>
								</div>
							</div>
							<div  class="form-group">
								<label for="corner_case" class="control-label col-sm-3">转角情况</label>
								<div class="col-sm-5">
									<p class='form-control-static'>
									<?php echo $media_draft_info['corner_case_name']==""?"无":$media_draft_info['corner_case_name']?>
									</p>
								</div>
							</div>
							<div  class="form-group">
								<label for="illumination" class="control-label col-sm-3">照明情况</label>
								<div class="col-sm-5">
									<p class='form-control-static'>	<?php echo $media_draft_info['illumination']==1?'有':'无'?></p>
								</div>
							</div>
							<div  class="form-group">
								<label for="flow" class="control-label col-sm-3">人车流量</label>
								<div class="col-sm-5">
									<p class='form-control-static'>
									<?php if ($media_draft_info['flow']==10) {
										echo "极大";
									}elseif($media_draft_info['flow']==20){
										echo "较大";
									}elseif($media_draft_info['flow']==30){
										echo "一般";
									}elseif($media_draft_info['flow']==40){
										echo "较小";
									}?>
									</p>
								</div>
							</div>
							<?php }else{?>
								<div  class="form-group">
									<label for="play_time" class="control-label col-sm-3">开屏时间</label>
									<div class="col-sm-5">
										<p class='form-control-static'>	<?php echo $media_draft_info['play_time']==""?'无':$media_draft_info['play_time']?></p>
									</div>
								</div>
								<div  class="form-group">
									<label for="play_time_remark" class="control-label col-sm-3">开屏时间备注</label>
									<div class="col-sm-5">
										<p class='form-control-static'>	<?php echo $media_draft_info['play_time_remark']==""?'无':$media_draft_info['play_time_remark']?></p>
									</div>
								</div>
								<div  class="form-group">
									<label for="play_format" class="control-label col-sm-3">播放格式</label>
									<div class="col-sm-5">
											<p class='form-control-static'>
												<?php if (stristr($media_draft_info['play_format'], "all")) {
													echo "不限 ";
												}if(stristr($media_draft_info['play_format'], "avi")){
													echo "AVI ";
												}if(stristr($media_draft_info['play_format'], "wmv")){
													echo "WMV ";
												}if(stristr($media_draft_info['play_format'], "mpeg")){
													echo "MPEG ";
												}if(stristr($media_draft_info['play_format'], "mov")){
													echo "MOV ";
												}if(stristr($media_draft_info['play_format'], "jpg")){
													echo "JPG ";
												}?>
												</p>
									</div>
								</div>
								<div  class="form-group">
									<label for="resolution" class="control-label col-sm-3">分辨率</label>
									<div class="col-sm-5">
										<p class='form-control-static'>
										<?php echo  $media_draft_info['resolution']?>
										</p>
									</div>
								</div>
								<div  class="form-group">
									<label for="play_frequency" class="control-label col-sm-3">播放频次</label>
									<div class="col-sm-5">
										<p class='form-control-static'>
										<?php echo $media_draft_info['play_frequency']?>
										</p>
									</div>
								</div>
								<div  class="form-group">
									<label for="play_frequency_remark" class="control-label col-sm-3">播放频次备注</label>
									<div class="col-sm-5">
										<p class='form-control-static'>
										<?php echo $media_draft_info['play_frequency_remark']?>
										</p>
									</div>
								</div>
							<?php }?>
							<div  class="form-group">
								<label for="sketch_map" class="control-label col-sm-3">媒体照片</label>
								<div class="col-sm-9">
									<table>
										<?php for ($i=0;$i<count($media_pic_list);$i++){?>
										<tr class="<?php echo "media_pic_".$i?>">
											<td>
												<img alt="媒体照片" src="<?php echo $this->config->item("ssi_file_url").$media_pic_list[$i]['pic']?>" class="form_img">
												<br />
											</td>
										</tr>
										<?php }?>
									
									</table>
									
								</div>
							</div>
							<div class="form-group">
								<table class="table table-hover">
									<thead>
										<tr>
											<td class="col-md-3">
										 		<b>时间</b>
										 	</td>
										 	<td class="col-md-2">
										 		<b>用户</b>
										 	</td>
										 	<td class="col-md-2">
										 		<b>操作</b>
										 	</td>
										 	<td class="col-md-5">
										 		<b>备注</b>
										 	</td>
										 </tr>
									</thead>
									<tbody>
										<?php if ($logs!=null) {
											foreach ($logs as $log){?>												
										<tr>
											<td><?php echo $log['create_time']?></td>
											<td><?php echo $log['create_by']?></td>
											<td><?php if ($log['operation_type']=="create") {
													echo "创建";
												}elseif ($log['operation_type']=="re_create") {
													echo "重新编辑";
												}elseif ($log['operation_type']=="submit_check") {
													echo "提交审核";
												}elseif ($log['operation_type']=="not_allow") {
													echo "拒绝通过";
												}elseif ($log['operation_type']=="update") {
													echo "编辑";
												}elseif ($log['operation_type']=="allow") {
													echo "通过审核";
												}?>
											</td>
											<td><?php echo $log['explanation']?></td>
										</tr>
										<?php if ($log['differents']!="") {?>
										<tr >
											<td colspan="4"><div class="open_detail">查看编辑详情[ + ]</div>
											<div style="display: none;"><?php echo $log['differents'];?></div>
											</td>
										</tr>	
										<?php }?>
										<?php	}
										}?>
									</tbody>
								</table>
							</div>		
							<div class="form-group">
								<label for="explanation" class="control-label col-sm-3">不通过审核说明</label>
								<div class="col-sm-5">
									<input id="explanation" type="text" name="explanation"  class="form-control">
									<input type="hidden" name ="media_draft_id" value="<?php echo $media_draft_info['media_draft_id']?>">
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-offset-3 col-sm-10">
									<a href="<?php echo base_url()."index.php/media_media_manage/allow_media"?>?media_draft_id=<?php echo $media_draft_info['media_draft_id']?>" class="btn btn-primary">通过审核</a> 　
									<button type="submit"  class="btn btn-danger">不通过</button>　　
									<a href="javascript:void()" onclick="history.back()">返回</a>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div  class="back-to" id="toolBackTop">
	<a title="返回顶部" onclick="window.scrollTo(0,0);return false;" href="#top" class="back-top">
	返回顶部</a>
	<a title="返回底部" onclick="window.scrollTo(0,document.body.scrollHeight);return false;" href="#bottom" class="back-bottom">
	返回底部</a>
</div>
</body>
</html>
